import requests


def search_elasticsearch(index_name, query_dict):
    headers = {'Host': '192.168.1.100:9200',
               'Content-Type': 'application/json'}

    r = requests.post('http://192.168.1.100:9200/' + index_name + '/_search', headers=headers, json=query_dict)

    print(r.json())


if __name__ == "__main__":
    post_dict = {"query": {"match_all": {}}}
    search_elasticsearch('pyshark', post_dict)
